<template>
  <el-card shadow="never" class="index">
    <template #header>
      <div class="card_header">
        <b>控制台</b>
      </div>
    </template>
    <div>
      <el-calendar v-model="value" />
    </div>
  </el-card>
</template>

<script setup>
  import { ref, onMounted } from "vue";
  import { storeToRefs } from "pinia";
  import { testsapi } from "@/api/index";
  import { useUserStore } from "../stores";

  const userStore = useUserStore();
  const { setUserInfo } = storeToRefs(userStore);

  const value = ref(new Date());

  // 获取个人信息
  const userInfo = () => {
    testsapi
      .GetUserInfo()
      .then((res) => {
        let { code, result } = res.data;
        setUserInfo(result);
      })
      .catch((err) => {});
  };
  onMounted(() => {
    userInfo();
  });
</script>

<style lang="scss" scoped>
  .card_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
</style>
